<include file="__THEME__/header" />
<link rel="stylesheet" href="../Public/event.css" type="text/css" media="screen" charset="utf-8" />
<script  type="text/javascript" src="__PUBLIC__/js/rcalendar.js" ></script>
<script type="text/javascript" src="../Public/js/event.js"></script>
<include file="../Public/_mainNav" />
<div class="content no_bg">
  <!-- 内容 begin  -->
  <div class="main no_l">
    <!-- 画布 begin  -->
    <div class="mainbox"> 
    	<include file="../Public/_isHotList" />
     	<div class="mainbox_C">
        <div class=page_title>
          <!-- page_title begin -->
          <h2><span class="right fn f12px"><a href="javascript:history.back( -1 )">返回上一页</a></span>{$title}</h2>
        </div>
        <!-- page_title end -->
        <div class="tab-menu">
          <!-- 切换标签 begin  -->
          <div class="right">
            {:W('Weibo',array('tpl_name'=>$_SESSION['new_event'] == 1?'event_create_weibo':'event_share_weibo','button_title'=>'分享'))}
			<php>
			    $tpl_data = urlencode(serialize(array(
			                  'author'=>getUserName($uid),
			                  'title'=>$title,
                              'url'=>U('event/Index/eventDetail',array('id'=>$id,'uid'=>$uid)),
                )));
			    $param_data = urlencode(serialize(array('has_status'=>1,'is_success_status'=>1,'status_title'=>'发起活动成功')));
			</php>
			<php>if($_SESSION['new_event'] == 1){</php>
			    <!-- 自动弹出分享 -->
			    <script>
			    $(document).ready(function(){
			    	_widget_weibo_start('', '{$tpl_data}', '{$param_data}');
			    });
			    </script>
			<php>unset($_SESSION['new_event']);}</php>			
            <input type="button" value="分享" class="BtnShare" onclick="_widget_weibo_start('', '{$tpl_data}');" id="BtnShare_{$id}"/>
          </div>
          <ul>
            <li><a href="{:U('//eventDetail',array('id'=>$id,'uid'=>$uid))}" class="on"><span>活动</span></a></li>
            <li><a href="{:U('//member',array('id'=>$id))}"><span>成员</span></a></li>
            <!-- <li><a href="{:U('/Index/photos',array('id'=>$id,'uid'=>$uid))}"><span>照片</span></a></li> -->
          </ul>
        </div>
        <!-- 切换标签 end  -->
        <div class="groupBox">
          
          <div class="boxL">
            <div class="box1 mLR15">
              <div class="info">
                <div class="img"> <img src="{$cover}" /> </div>
                <div class="list">
                  <ul>
                    <li>
                      <div class="c1">发起者：</div>
                      <div class="c2"><space uid="uid" class="fn">{uname}</space></div>
                    </li>
                    <li>
                      <div class="c1"> 活动类型：</div>
                      <div class="c2"> {$type} </div>
                    </li>
                    <li>
                      <div class="c1"> 活动区域：</div>
                      <div class="c2"> {$city} </div>
                    </li>
                    <li>
                      <div class="c1"> 活动地点：</div>
                      <div class="c2"> {$address} </div>
                    </li>
                    <li>
                      <div class="c1"> 活动时间：</div>
                      <div class="c2"> {$time} </div>
                    </li>
                    <li>
                      <div class="c1"> 截止报名：</div>
                      <div class="c2"> {$dl} </div>
                    </li>
                    <li>
                      <div class="c1"> 剩余名额：</div>
                      <div class="c2"> {$lc} </div>
                    </li>
                    <li>
                      <div class="c1"> 需要审核：</div>
                      <div class="c2">
                        <?php if( $opts['allow'] ) {echo'是';}else{echo'否';}?>
                      </div>
                    </li>
                    <li>参加人数（{$joinCount}） 关注人数（{$attentionCount}）<if condition="$verifyCount">待审人数（{$verifyCount}）</if></li>
                    <?php if( $deadline>time()){ ?>
                    <li> <span class="cGreen lh35" id="event_satus">此活动正在进行中……</span> </li>
                    <li>
                      <?php if( $admin ){ ?>
                      <span id="event_edit_button">
                      <button class="btn_b" style="margin-right:5px;" onclick="javascript:endEvent( '{$id}' )">提前结束</button>
                      <button class="btn_b" style="margin-right:5px;" onclick="javascript:location.href='{:U('/Index/edit',array('id'=>$id))}';">编辑活动</button>
     				  <button class="btn_b" style="margin-right:5px;" onclick="javascript:delEvent( '{$id}' ,true)">删除活动</button>
                      </span>
                      <?php } ?>
                      <span class="detail_joinIn_{$id}">
                      <?php if( $follow ){ ?>
                      <?php if( $canJoin ){ ?>
                      <?php if( $limitCount>0 ) { ?>
                      <button class="btn_b" style="margin-right:5px;"  onclick="javascript:EventAction( {$id},{$opts['allow']},'joinIn')">我要参加</button>
                      <?php }else{ ?>
                      <span class="cGreen lh35">名额已满</span>
                      <?php } ?>
                      <?php }else if( false == $admin ){ ?>
                      <?php if( $opts['allow'] == 1 && $hasMember != 1){ ?>
                      <span class="cGreen lh35">已提交申请,等待审核中,<button class="btn_w" style="margin-right:5px;" onclick="javascript:EventDelAction({$id},{$opts['allow']},'joinIn')">取消申请</button></span>
                      <?php }else{ ?>
                      <button class="btn_w" style="margin-right:5px;"  onclick="javascript:EventDelAction( {$id},{$opts['allow']},'joinIn')">取消参加</button>
                      <?php } ?>
                      <?php } ?>
                      <?php } ?>
                      <?php if( $canAtt ){ ?>
                            <span class="detail_attention_{$id}">
                            <button class="btn_b"  style="margin-right:5px;"  onclick="javascript:EventAction( {$id},null,'attention')">我要关注</button>
                            </span>
                      <?php }else if( false == $admin && true == $canJoin){ ?>
                            <span class="detail_attention_{$id}">
                            <button class="btn_w"  style="margin-right:5px;"  onclick="javascript:EventDelAction( {$id},null,'attention')">取消关注</button>
                            </span>
                      <?php } ?>
                      </span>
                    </li>
                    <?php }else { ?>
                    <li>
                      <span class="cGreen lh35">此活动已经结束,报名时间已到</span>
                    </li>
                    <?php } ?>
                  </ul>
                </div>
                <div class="c"></div>
              </div>
            </div>
            <div class="box1 mLR15">
              <h3><strong>活动介绍</strong></h3>
              <div class="lh180" style="word-wrap:break-word;">{$explain}</div>
            </div>
            <div class="box1 mLR15">
              <h3><span class="alR lh30n right f12px"><a href="{:U('//member', array('id'=>$id,'action'=>'join'))}">查看全部>></a></span><strong>活动成员</strong>(共{$joinCount}人)</h3>
              <ul class="pic50box">
                <volist name="member" id="vo">
                  <li><span class="headpic50"><a href="{:U('home/space/', array('uid'=>$vo['uid']))}" target="_blank"><img src="{$vo['uid']|getUserFace}" /></a></span><a href="{:U('home/space/', array('uid'=>$vo['uid']))}" target="_blank">{$vo['uid']|getUserName}</a></li>
                </volist>
                <div class="c"></div>
              </ul>
            </div>
            
{:W('Comment',array('type'=>'event','appid'=>$id,'author_uid'=>$uid,'title'=>$title,'url'=>U('event/Index/eventDetail',array('id'=>$id,'uid'=>$uid)),'table'=>'event','id_field'=>'id','comment_count_field'=>'commentCount'))}
            </div>
            <div class="c"></div>
          <!-- end  -->
        </div>
      </div>
      <div class="c"></div>
    </div>
  </div>
  <!-- 画布 end  -->
  <script  type="text/javascript" src="../Public/js/preview.js" ></script>
  
</div>
<!-- 内容 end -->
<include file="__THEME__/footer" /> 